1. Field of the Invention
The present invention relates to an electronic device for carrying out a process of saving data in a case in which a power supply voltage is suddenly cut off, such as a case in which a commercial alternating current power source is broken down, and a method of controlling the same.
2. Description of the Related Art
In an electronic device using a micro-processing unit (MPU), in the case that the power supply voltage is suddenly cut off, a data saved in a non-volatile memory is the data stored in a random access memory (RAM) at that time. For example, in a known technology, an integrated circuit (IC) for power monitor is used for monitoring the power supply voltage and outputting a signal to a non maskable interrupt (NMI) terminal of the MPU so as to save the data into a non-volatile memory when a decrease in the power supply voltage is detected. Further, in another known technology, a reset signal is outputted when the power is turned off so as to prevent a circuit in the electronic device from malfunctioning.
In a typical electronic device, the MPU starts saving of data when a detection signal indicating a decrease in power supply voltage, the signal outputted from the IC for power monitoring, is inputted to the NMI terminal of the MPU. The detection signal is delayed for a fixed period of time by means of a delay circuit to form a reset signal. The MPU stops an operation of the electronic device in accordance with the reset signal.
In the related art described above, a delay circuit must be provided in order to secure the time for saving the data stored in the RAM in the non-volatile memory in the case of the decrease in power supply voltage. This makes a structure of the electronic device complicated.